
<body>
    <div class="x-body">
        <form class="layui-form">
            <div class="layui-form-item">
                <label for="level-id" class="layui-form-label">
                    id
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="level-id" name="level-id" disabled="" value="20" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label for="level-name" class="layui-form-label">
                    <span class="x-red">*</span>事件
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="level-name" name="level-name" required="" lay-verify="required"
                    autocomplete="off" value="回复" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label for="level-kiss" class="layui-form-label">
                    <span class="x-red">*</span>积分
                </label>
                <div class="layui-input-inline">
                    <input type="text" id="level-kiss" name="level-kiss" required="" value="10" lay-verify="required"
                    autocomplete="off" class="layui-input">
                </div>
            </div>
            <div class="layui-form-item">
                <label for="L_repass" class="layui-form-label">
                </label>
                <button  class="layui-btn" lay-filter="save" lay-submit="">
                    保存
                </button>
            </div>
        </form>
    </div>
    <script>
        layui.use(['form','layer'], function(){
            $ = layui.jquery;
          var form = layui.form()
          ,layer = layui.layer;
        
          //监听提交
          form.on('submit(save)', function(data){
            console.log(data);
            //发异步，把数据提交给php
            layer.alert("修改成功", {icon: 6},function () {
                // 获得frame索引
                var index = parent.layer.getFrameIndex(window.name);
                //关闭当前frame
                parent.layer.close(index);
            });
            return false;
          });
          
          
        });
    </script>
    <script>
    var _hmt = _hmt || [];
    (function() {
      var hm = document.createElement("script");
      hm.src = "https://hm.baidu.com/hm.js?b393d153aeb26b46e9431fabaf0f6190";
      var s = document.getElementsByTagName("script")[0]; 
      s.parentNode.insertBefore(hm, s);
    })();
    </script>
</body>